package com.serbulent.examples.rest.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.serbulent.examples.rest.dao.IBookDAO;
import com.serbulent.examples.rest.model.Book;

@Service("BookService")
@Repository
public class BookServiceImpl implements IBookService {
	
	@Autowired
	IBookDAO bookDao;
	
	/* (non-Javadoc)
	 * @see com.serbulent.examples.rest.service.IBookService#getAllBooks()
	 */
	public List<Book> getAllBooks() {
		List<Book> bookList = bookDao.getAllBooks();
		return bookList;
	}
	
	/* (non-Javadoc)
	 * @see com.serbulent.examples.rest.service.IBookService#getBookById(int)
	 */
	public Book getBookById(int id){
		return bookDao.getBookById(id);
	}
}
